package tests;

import java.util.ArrayList;
import java.util.Iterator;

import javax.vecmath.Point3d;

import primitive3D.Primitive3D;
import primitive3D.Quadrilateral;
import primitive3D.Sphere;
import primitive3D.Triangle;


public class TestPrimitive3D {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		ArrayList<Primitive3D> myList = new ArrayList<Primitive3D>(); 
		
		Point3d[] triPoints = {new Point3d(1,2,0), new Point3d(0,-2,0), new Point3d(4,-8, 0)};
		Point3d[] QuadPoints = {new Point3d(1,2,0), new Point3d(0,-2,0), new Point3d(-4,-8, 0), new Point3d(5,-9,0)};
		
		Triangle tri = new Triangle(triPoints);
		tri.setName("T1");
		tri.setPosition(new Point3d(1, -2, 0));
		
		Quadrilateral quad = new Quadrilateral(QuadPoints);
		quad.setName("Q1");
		quad.setPosition(new Point3d( 1, 1, 0));
		System.out.println(quad);
		quad.scale(2);
		System.out.println(quad);
		
		Sphere sphe = new Sphere( new Point3d(2,2,2), 4);
		sphe.setName("Redooondo");
		
		myList.add(tri);
		myList.add(quad);
		myList.add(sphe);
		System.out.println("\nPRIMITIVES LIST\n" + myList);
		
		Iterator<Primitive3D> it = myList.iterator();
		
		while( it.hasNext() ){
			System.out.println(it.next().getName());			
		}
		
	}

}
